<?php
class invite extends Controller {
	
	public $viewData;
	
	function invite() {
		parent::Controller();
		
		$this->viewData->title = "CartPool - Cart";
		$this->viewData->description = "Collaborative shopping";
		$this->viewData->keywords = "CartPool, shoppingcart";

		$this->viewData->css = array("reset", "960", "720_8", "cartpool_style", "smoothness.datepick");
		
		$this->viewData->js = array(	"jquery-1.3.2.min",
										"jquery.accordion-1.2.2", 
										"jquery.popupWindow", 
										"cufon-yui", 
										"segoe_400.font", 
										"jquery.form", 
										"jquery.autofill", 
										"jquery.datepick.min", 
										"pretty", 
										"cartpool_common", 
										"cartpool_invite");
		
		$this->load->library('cartpool');
		$this->load->library('session');
		$this->load->helper('url');
		
		$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate");
	}
	
	function index() {
		
		
		if($this->session->userdata('logged_in')){
			$this->viewData->cartpoolData = $this->cartpool->getCartpoolData();
			
			$this->viewData->uriString = uri_string();
			
			$this->viewData->topInfo_html = $this->load->view('top_info', $this->viewData, true);
			$this->viewData->navigation_html = $this->load->view('navigation', $this->viewData, true);
			
			$this->viewData->productList_data = $this->load->view('products_data', $this->viewData, true); 
			$this->viewData->leftColumn_html = $this->load->view('register_login', $this->viewData, true);
			
			$this->viewData->userList_data = $this->load->view('user_list', $this->viewData, true);
			$this->viewData->rightColumn_html = $this->load->view('invite_users', $this->viewData, true);
			
			$this->load->view('index', $this->viewData);
		}else{
			//not logged in
			 redirect('/', 'location');
		}
		
	}
}